Skip to content

fix(cookies): restore cookie bridge in server mode for cross-tab auth#608

Merged
shaun0927 merged 1 commit intodevelopfrom
fix/scope-cookie-bridge-skip
Apr 9, 2026
Merged

fix(cookies): restore cookie bridge in server mode for cross-tab auth#608
shaun0927 merged 1 commit intodevelopfrom
fix/scope-cookie-bridge-skip

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

Summary

Fixes #606 — Root Cause C: skipCookieBridge was set globally in server mode, breaking cross-tab cookie inheritance.

  • Previously, --server-mode called setGlobalConfig({ skipCookieBridge: true }), which disabled cookie bridging for all page creations in the process
  • This meant tab 2 could not inherit session cookies from an authenticated tab 1, even within the same session
  • The skip was only ever needed for pool pre-warming (creating blank about:blank pages) to avoid CDP session conflicts — not for normal page creation

Root Cause C

CDPConnectionPool.createNewPage() already passes skipCookieBridge: true explicitly as the third argument to createPage():

const page = await this.cdpClient.createPage(undefined, undefined, true); // pool pre-warming

So the global flag in server mode was redundant for pool pre-warming and harmful for normal page creation. Removing it restores cookie bridging for user-initiated tab creation while pool pre-warming continues to skip it per-call.

Changes

  • src/index.ts: Removed setGlobalConfig({ skipCookieBridge: true }) from server mode startup
  • src/cdp/client.ts: Updated stale comment to reflect that the global flag is a manual override escape hatch, not set automatically by server mode

Test plan

  • Build passes: npm run build
  • Cookie/pool tests pass: npm test -- --testPathPattern="cookie|connection-pool"
  • In server mode, authenticate in tab 1 — tab 2 should inherit those cookies on navigation
  • Pool pre-warming still skips cookie bridging (no CDP session conflicts on about:blank)

🤖 Generated with Claude Code

…e server mode

Previously, server mode set skipCookieBridge globally via setGlobalConfig(),
disabling cookie bridging for ALL page creations. This meant tab 2 would not
inherit cookies from an authenticated tab 1 within the same session (issue #606).

The skip was only needed for pool pre-warming (about:blank pages) to avoid CDP
session conflicts. CDPConnectionPool.createNewPage() already passes
skipCookieBridge=true per-call, so removing the global flag is safe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shaun0927 shaun0927 merged commit 08a0e12 into develop Apr 9, 2026
9 checks passed
@shaun0927 shaun0927 deleted the fix/scope-cookie-bridge-skip branch April 9, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant